added $WORKSPACE check to be sure it's set
remove old artifacts before building
fixed latest_version() call and symlink creation