fixed bugs thrown when using gil on CLI