changed switch from type to boolean