bug fix: add check for file before we try and remove it