fix returning from opened file