add the logic of background handler