Small check to prevent main thread exception.
Merge pull request #142 from zobo/development

Small check to prevent main thread exception.