Proper cleanup on render