role check moved in better position