fixed some error in cases