added synchronized buffer again/bug fixes