Fixing bug which occurred if clicking something out of bounds