fix ending bug & add angle to change move direction