remove duplicates inside if..else block
Merge pull request #3 from nuweb/master

move statement outside if..else block