fixed some bugs in the anticrash

Signed-off-by: perakerosenlund <Enigma1676@gmail.com>