database now closes before quit