Add timeout argument to cmd()