added role and redirect code