fix #36: some locking added
fix #36: some locking added

AlexeyKupershtokh/pinboard,intaro/pinboard,intaro/pinboard,crashr42/pinboard,AlexeyKupershtokh/pinboard,mehulsbhatt/pinboard,mehulsbhatt/pinboard,crashr42/pinboard,mehulsbhatt/pinboard,AlexeyKupershtokh/pinboard,intaro/pinboard,crashr42/pinboard