Fixing ready event