bugfix (append fname, not dir)