add event handler when phonegap ready