Fixing provider calling itself endless loop