added code to prevent crash if Valgind fails to run
invalid file not moving to failed folder fixed