Changed assertion to be more reliable