better handling for file open types