do more error checking