fixed the bug where the snake can turn back on itself