fix code errors as per feedback