Fix undefined post type error