fixed sql error - db insertion working