changed == to .equals() in helper method