LPS-52047 delete file if nothing went wrong
LPS-52047 fix relative paths