add timeout to shell command
change code structure