wrap function in exists