added exists function