fix problem with equals. Added local variable.