updated with some corrections

corrected the functions for the error messages.