better handling of shell interaction