fix case bugs