Added some memory cleaning, works fine in simulator but... :(