Updated check for validating file exists of scripts