fixed GCM callback functions
better defined function