prevent some crashes