added synchronized

Signed-off-by: Peter <mcheung63@hotmail.com>