finally stored the inputs to the database