set data before checking for primary key in crud model's constructor