loc-add function