fixing error with unclosed elements