Callback functions added: ok, end, err