Made pushnotification handler a global function.