Added close function to database class