fixed "raced condition" between two onLoad listener