File memory issue fix