fixed error in method comparing