fixed directory handling when other than current working directory