updated to fixed code