added retry to check_statement