use try-catch for updating modvars