added the empty source check