fixed background gradient switching code