handling errors when getting sources