Added null checking for Equals