Problems with the spoiler function