isPermissionGiven corrected