use filename as passed in instead of relative path from dirname to filename