integration test and fixed implementation