before inserting when()