fix the stuck in corner problem