Added a safety check
Merge pull request #11 from nhaarman/bugfix_7

Added a safety check