fixing the bug

this bug fix closes #2