fix few crashes