added exception for typeerror in lifespan