fixed javascript type bug