only change back to dir if it was valid
only change back to dir if it was valid

CyberReboot/vent,Jeff-Wang93/vent,lilchurro/vent,cprafullchandra/vent,bpagon13/vent,cglewis/vent,CyberReboot/vent,bpagon13/vent,Jeff-Wang93/vent,Jeff-Wang93/vent,lilchurro/vent,CyberReboot/vent,cglewis/vent,lilchurro/vent,cprafullchandra/vent,bpagon13/vent,cglewis/vent