proper lock/read/write usage impelemnted