Fixing memory issue with mac models