Add a safety check