fixed memory and moved modells