fixing mem leak in operator=