fix bug in comparison