pass keys to callback functions (onResume, onCancel, onPause)
handle errors