Fixed hanging on end of turn issue