If you want a cream cheese frosting with even more stability for piping, the best way I've found is refrigerating it for 15-30 minutes and/or mixing in 1 tablespoon of cornstarch. If you're making cupcakes but aren't going to serve them immediately after piping, stick them in the fridge to retain the piped shape as well.