fix bug in wp_generate_results