added fclose to fileIO