added nil check before setting background color to the wrapped view