fixed code in issue1