fix LWP lifecycle