fix some warning or notice bugs