sync functionality mostly works