Adds regex match for a valid file and removes verbose errors