workaround broken mfilename() with pwd()