add loc helper
Add tests for #1866 - loc helper