fix init function, should take an boolean value as a template argument.