fix work bug from RK stuff. Fix many crashing