add error handling for notification
free errors