bugfix: now after error change dir correctly