Moved the update post ID queries to top, just to make sure things are not converted multiple times.