fix some cirtical errors