Fix repeating sync bug