fixed small code errors