fix the bug of permission check