Fix function formatSourceData

Cheks if the information provided by the source is a string or not.