fixed issue #32
fixing bugs