fixed bug causing crash on actual device when using where method