apns error handling and retrying
minor changes