changed if to expect