added database.close() implementation