set correct type for incoming stream