fix maths error