Update main_class.php

Fixed the bug that was stopping the post from working when initially published.