correct logic for --replace with SANDBOX and JCMT