fix illegal validation errors for before all and after all
clean up