adding error messages; cleaning up