corrected snippet