Added lifecycle functionality