handle gcm end