compare functions bugfix