adding support for origin heartbeat callback and error callback