fix 5 issues raised by reviewer