trying to fix update color when clicking on a rect