Changed publish code to handle load rules