Fixed bug when run on an ipad