Javascript fix for phones