change order for checking callable and object in render because if your object implements __invoke magic method it tries (and fails) to render it as a callable function