role and functionality entity bugs all fixed!!!!!!!!!!