fixed error conditions