Added exists function.