use a better approach for the check