fixed JS issue with editor initialization