added user authentication and error messages for validation