Adding error checking for the role