update to deployment code section to check that we are not replacing the same deployment