test for lifecycle