Do some checks before running commands