fixed error in turn logic