fixing code errors