fixed minor bug for custom post types