added missing $post_type variable