replacing TMP_DIR with OUTPUT_PREFIX variable