Buddypress: Display multiple custom post types on member’s profile

This is the updated working code in stats-profile.php which together with code above in bp-custom.php (buddypress functions.php) gives me the title(s) of displayed user for multiple custom post types.

<?php
        if ( is_user_logged_in() ):

        query_posts(array(
                'post_type' => array( 
            'post',
            'portfolio',
            'applicant',
            'agency',
            'employer'  
         ),
                'author' => bp_displayed_user_id(),
                'showposts' => 3
            ) );  
        ?>
        <?php while (have_posts()) : the_post(); ?>
                <h3><a href="https://wordpress.stackexchange.com/questions/107291/<?php the_permalink() ?>"><?php the_title(); ?></a></h3>

        <?php endwhile;

        else :

            echo "";

        endif;
        ?>