now storing data in database after pressing record button