fix to prev changeset
unit test and "80% integration test" is implemented