fix the constructor's type-autodetection accepts wrong parameters