resolve the problem of required and min check