fix potential container lifecycle issue