add on_exit callback
add methods to utils