fix bug with type