check length constrain