fixed the undefined type bug