fix popstate for phonegap 2