add option for dirty cache, fixed a bug related to pid initialization