bug fix for assignPermissions