fixed 'indexOf of undefined' error
Merge pull request #2 from christian-fei/master

Fixed 'indexOf of undefined' error