fixed some bug, equal function doesn't work