fixed bug in ammm K-cleanup