bug & warning fixing