Variable scoping inside EVERY statement fixed