Fixing scenario where a soup object is returned

Fixing scenario where a soup object is returned instead of a string.