fixing issue them compare with old state were done before filtering