change substring to trim()
update button disabling