fixed bugs to make cucumber tests passed