improved validate
Merge pull request #9 from willtp87/7.x.file_select

improved validate