Added error check for the prompt