fixing initialization bug