fixed logic test of args for filename function