prevented some crashes