Fixed insert into database bug. Need to fix read from database