Fix compare to use DB