added if statement to nextPrompt function