Added error handling for remote notifications