fixing validation of files or templates existing