Database closing added