fix sync method and add more debug info to log