fixed up error conditions