added clean exit for file open failure