Controller: Added checks and display error messages