Added a filename check.