Memory issues fixed