Changed placement of background setting code