moved logic to background manager