corrected the snippet