add sync function to the example app