fix repositioning bug