checking resource before make request
Merge pull request #105 from wtfil/security-fix

checking resource before make request