avoid crashes