Fix direction bug