fixed compare with db