added process termination feature and some fixes