timeout for command execution

fixes #429
fixes #487