Fixed possible crash
Fixed all possible crashes