re-arranging order of initialization to ensure we don't miss any events