minor changes to database aspect of script