fix dirty detection