fix bug where init is fired twice