fixed bug when using hapi joi as type