bug fix and add sync functions