Added better cleaning the list. From now there aren't any deadlocks.