hopefully removing error in deleting keys (i think it works)