fixed code snippet