Fix setting max length
respond to value change