another code snippet update for new API