updated roles logic