Fixed so that it works with guards.