replaced synchronized blocks with read/write locks