Added loading flag when done() is called