change insert to db solution