fixed bug with points on the border