fix bug with types