detect bg changed