Addressing an issue with infinite loop for a BashDriver