added validextensions and removed nested if
Merge pull request #1 from phillip-haydon/ValidExtensions

added validextensions and removed nested if