fixed memoryleaks on add maps