fix small bugs in previous