add fence

add fence
and replace map