bit more error checking