small mem bugfix