add empty map supprot and test
merge from github