removed bad db.close()