fixing JSON type error