Added alerts and error message.