Added synchronized blocks.