fixed ai direction bug