fixed bug in sync and added check for truncated results