Add safety check