fixed initialization bug on initial load