State machine fixed

Added quit command