Made proper "wait for attached"