Added code to insert data into database