having to double click using .click and .text

having to double click using .click and .text

Hello,
I have the script below to toggle open and close identified divs on a page. On page load I have to click twice on the link for it to work (from there on, one click suffice). Can someone help me with what is wrong with it?
Thanks

script
  1. <script type="text/javascript">
  2. $(document).ready(function(){
  3. $("#toggle_all").toggle(function(){
  4. $(".toggle_container_wide").slideUp(80);
  5. $("h5.trigger").addClass("active");}, function () {
  6. $("h5.trigger").removeClass("active");
  7. $(".toggle_container_wide").slideDown(80);
  8. }); });
  9. $('#toggle_all').click(function() {
  10. $(this).text($(this).text() == ' Open All' ? '- Close All' : ' Open All');
  11. return false;
  12. });
  13. </script>
html
  1. <a id="toggle_all" href="#">Open All</a>