added extra check to ==