bug fix to make '!' and '~' in location policy working