Added proper error messages