Fixed reference issues
Modified def update_post