I think `wait_for_state` is more appropriate name for this method. Please also fix all variables inside the method.