fixed bug in filename passing