added unit and integration test