fixed error in DB insertion.