fixed read bugs,and needs to add mutex to the code