add safemap and test