fix bug when opening non existing files