This is the fixed code