adding bounds checking (for clicks)