change assert across to explicit safety check