fix caseid if statements and pretty up tabs