new path and filename code thanks to sezero of uhexen2