chaning background color based on view status