enhance error handlings. sending notifications on thread.