more error handling in open()s