fixed code to match problem