try to fix dirname missing