fix bug in back compat dir code