updated click functionality