removes dirty keys