Add checkAlert method.