directory patching bug fix