fix(main): fix broken dependencies

the side effect is I also fix the broken initilization steps. Things I should keep in mind when the key I look for is not exist yet it will be NaN
Merge branch 'fix'