Updated exists functionality