tried making isAlive a function instead