fixing the sync script to write back the page id