some fixed error handling