fixed db.close() again