Fixed bug with adding and removing sources at the same time