Added check to pass the filename to the view.