checks and error messages