added checks on the copyin step to test if it is needed