fix bugs about res in raw