simplify shell commands
don't run if null input
Add exception when check failed