fix to compile and run on simulator and phone