Correct usage of filename variable