setInvalid now takes boolean input