ticket:3 fix database error which and in ticket:1