bug fixed and code review