Change listeners to accomodate phonegap and desktop simultaneously