fix apple over snake and undefined direction