working version that auto syncs with cloud data