fixed bugs created in last commit (issue #3)