fix bug for empty source