fixed equality code