fixed JS type errors