cleaned up file handler