Ensure $sources is Array before use