Fixed javascript error in svg