Updated app.sync() method