fix handling of run dir