added comprehensive error messages