Fix safe check bug