Added check for bad roleId