improved waiting for init