Fix memory management
Fix for ipad