Fix bug in sync gem