Fixed potential NPE, fixed comparison to use equals which is more appropriate for String