Not closing the same file several times