paranoid check to prevent crash