added an option for setting the max postcount and fixed a bug