fixed the type error