this and the vcs check should be in line 155 above. DRY'er code