revent button from going off edge