Added timeouts and checks for commands