Creating elements bug fixing