improved leack detection in test