fixed code errors