added some freeing for #61