Resolved Memory issues by overloading equals operator