fix binary operator syntax error and infinite loop when autoresume directory
existed