bug fixed: insert data into database