Finally do all the open checks inside open_file(). Checks inside