fix bug to check post type