Adding exists function