crud + fix for memory leak