added memory check to preferences