Add additional safety check