fixed directory creation logic in testing