mutlithreading fix in put()