update background function