Added error checking and prompt.