avoid invalid property id, javascript tidy