Made all methods synchronized to avoid "queue" conflicts.