Actually, a better way is to check the existence of `$loc` and leave this line as is. Figured we could just check in the JS.