auto creation of pages at activating blogs

in the functions.php file of the default theme for the sub-blogs.


function my_default_pages(){

	$default_pages = array('Home','About','Contact');
    	$existing_pages = get_pages();

	foreach($existing_pages as $page){
        	$temp[] = $page->post_title;

	$pages_to_create = array_diff($default_pages,$temp);

	foreach($pages_to_create as $new_page_title){

		// Create post object
	        $my_post = array();
	        $my_post['post_title'] = $new_page_title;
	        $my_post['post_content'] = 'This is my '.$new_page_title.' page.';
	        $my_post['post_status'] = 'publish';
	        $my_post['post_type'] = 'page';

	        // Insert the post into the database
	        $result = wp_insert_post( $my_post );

what do you say? any suggestions about why it doesn't work?
it supposed to be very simple...