fix max length longer than value length behavior