fix ugly check