fixing the empty set insert into db