You may have added too much powdered sugar or over mixed the batter. You can try whipping in a few tbsp of cornstarch, then refrigerating the frosting for 20-30 minutes.