fixed implementation