fix possible crash
fix style