fix a bug in sychronized method