Prevent crashes