fix crash on exit
fix compile after 2 prev commits