restore variables before executing commands