fixed error message
some cleanups