workaround for missing loc function