corrected code snippet