fixing it so res doesn't get overwritten when executed right after a cpy command