update script to write to db