fclose should be run on file handler not name