Well, to my mind, the OP's code was correct, even if not complete with all error checking. You're absolutely right that his|her error checking leaves him|her wide open for assuptions about the underlying system state to cause a failure. Making my point. :D