Adding check to $ exists