bug fixes for the sync call.