cherry pick 'add security check'