Properly escape dir field