Added callbacks for loaded and loading