Example working, but not executing on the right order