added isalive method and fixed some minor errors