bugfix: filename check moved to inner layer.