added make_safe_callback, added retry for communication errors