try to allow reaching end of file