rewrote a lot of stuff now it compiles, but its still broken

search for 'undefined'
and cases on React where i ignore all the error cases
fixed an undefined situation