fixed double call to loaded() function