check whether source and destination exists when comparing