Changed string comparisons from == to .equals check