adds click functionality