minor fix
memory problems fixes
minor fixes