fix error move head condition