fix bug for init() be called twice.