fix the issues from code review