move selection box code into selectshape function