Fixing a bug in updating local prefix