fixing infinite guest loop