It would be better to listen for 'change' instead of 'sync'