fixed some direction bugs