fixed code snippit