refactor role setter
add layer check
refactor set role