using elsif instead of else to properly catch this condition
Merge pull request #556 from gogogarrett/master

using elsif instead of else to properly catch this condition