fix issue #3 +tests