added code to set bg