use sychronize for lock