Checks if return value is a string or not, before rendering. fixes #2014

Fixes the bug returning a 500 page on some projects with submodules #2014