fixing bugs from code review
merged