updated condition to check whether source exists