fixed code thanks to integration test