Added leave functionality from command line