fixed double initialization bug