Added an error message that indicates when something goes wrong so that the user is not left on a blank screen.