Fixes error caused by asynchronous error in notification funciton