fixed bugs while improving code coverage
increasing test coverage