fixed issue #5 and implemented exit command