Fixed move bug and optimized