Bug fixes and code implovements

Fix problem when use pesrsistantContent property and preserve modal_id attribute on element.