fix direction bug