fix popstate for phonegap