Avoid possible crashes